package ihm.controller;

import javax.swing.JDialog;
import javax.swing.JOptionPane;

import ucc.Service;
import uccimpl.DebtService;
import uccimpl.PersonService;
import domain.Debt;
import domain.Person;

public class MainFrameController {
	
	Service<Debt> debtService = DebtService.getInstance();
	Service<Person> personService = PersonService.getInstance();
	
	public static enum ContentFrame {
		DEBTS,
		CHART,
		PERSONS,
		DATABASE
	}
	
	public void handle(ContentFrame cf) {
		switch(cf) {
		case DEBTS:
			break;
		case CHART:
			break;
		case PERSONS:
			break;
		case DATABASE:
			debtService.saveToDatabase();
			personService.saveToDatabase();
			//TODO: create new jdialog machin
			JOptionPane.showMessageDialog(null, "Save to database successful", "Database save", JOptionPane.INFORMATION_MESSAGE);
			break;
		default:
			break;
		}
	}
	
}
